package com.hmall.common.client;

import com.hmall.common.dto.Item;
import com.hmall.common.dto.ItemDTO;
import com.hmall.common.dto.PageDTO;

import org.springframework.cloud.openfeign.FeignClient;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@FeignClient(value = "itemservice")
@RestController
public interface ItemClient {

    @GetMapping("item/findByPageSearch")
    PageDTO<ItemDTO> findByPageSearch(@RequestParam Integer page,@RequestParam Integer size);


    /**
     * 根据id查询数据
     */
    @GetMapping("/item/{id}")
    Item selectById(@PathVariable Integer id);



    /**
     * 处理分页数据
     * @param page
     * @param size
     * @return
     */

    @GetMapping("item/list")
    PageDTO<Item> Page(@RequestParam Integer page , @RequestParam Integer size);

}

